Method for adjusting sound playback and portable device thereof

ABSTRACT

A method for adjusting sound playback of a portable device for constancy notwithstanding different environments outputs from the portable device detectable audio signals inaudible to user and the device receives reflected audio before the portable device is actually commanded to play an audio file. A list of volume weightings for reflected audio is calculated. Before commencing playback of the audio file, the portable device obtains reference volume weightings from a list according to the current volume setting, and calculates adjustment coefficients for different frequency bands based on weightings of the reference volume list and of the reflected audio list. The audio signals of the audio file are output after adjustment. A portable device is also disclosed.

FIELD

The subject matter herein generally relates to digital processingtechnologies.

BACKGROUND

The volume and clarity of a portable device playing music can changesignificantly if it is placed on a different surface or type of surface,or once it is carried into a different room. Achieving automaticadjustment of sound reproduction according to the surface and theenvironment in which the portable device is placed is problematic.

BRIEF DESCRIPTION OF THE DRAWINGS

Implementations of the present technology will now be described, by wayof embodiment, with reference to the attached figures, wherein:

FIG. 1 is a block diagram of one embodiment of a portable device.

FIG. 2 is a flow chart of one embodiment of a method for adjusting theoutput of sound to achieve optimal reproduction.

FIG. 3 is a schematic diagram of one embodiment of contours of equalloudness of the method for adjusting the sound output.

FIG. 4 is a schematic diagram of one embodiment of matrix operation ofthe method.

FIG. 5 is a flow chart of another embodiment of a method for adjustingoutput of sound.

DETAILED DESCRIPTION

It will be appreciated that for simplicity and clarity of illustration,where appropriate, reference numerals have been repeated among thedifferent figures to indicate corresponding or analogous elements. Inaddition, numerous specific details are set forth in order to provide athorough understanding of the embodiments described herein. However, itwill be understood by those of ordinary skill in the art that theembodiments described herein can be practiced without these specificdetails. In other instances, methods, procedures, and components havenot been described in detail so as not to obscure the related relevantfeature being described. Also, the description is not to be consideredas limiting the scope of the embodiments described herein. The drawingsare not necessarily to scale and the proportions of certain parts may beexaggerated to better illustrate details and features of the presentdisclosure.

References to “an” or “one” embodiment in this disclosure are notnecessarily to the same embodiment, and such references mean “at leastone”.

In general, the word “module” as used hereinafter, refers to logicembodied in computing or firmware, or to a collection of softwareinstructions, written in a programming language, such as, Java, C, orassembly. One or more software instructions in the modules may beembedded in firmware, such as in an erasable programmable read onlymemory (EPROM). The modules described herein may be implemented aseither software and/or computing modules and may be stored in any typeof non-transitory computer-readable medium or other storage device. Somenon-limiting examples of non-transitory computer-readable media includeCDs, DVDs, BLU-RAY, flash memory, and hard disk drives. The term“comprising”, when utilized, means “including, but not necessarilylimited to”; it specifically indicates open-ended inclusion ormembership in a so-described combination, group, series, and the like.

FIG. 1 illustrates a portable device (portable device 100) which canoutput sound, according to an embodiment. The portable device 100 may bea portable device capable of running applications, such as a mobilephone, a tablet, a set-top box, a multimedia player, and a smartspeaker. The portable device 100 comprises a processor 102, a memory104, a sound playing device 106, and a sound receiving device 108. Theprocessor 102 is electrically coupled to the memory 104, the soundplaying device 106, and the sound receiving device 108. The processor102 may be a microcontroller, a microprocessor, a complex instructionset arithmetic microprocessor, a reduced instruction set arithmeticmicroprocessor, an ultra-long instruction set microprocessor, anultra-parallel instruction set arithmetic microprocessor, and a digitalsignal processor or other circuits with computational processingcapabilities. The processor 102 is configured to execute or processinstructions, data, and computer programs stored in the memory 104. Thememory 104 comprises a read-only memory (ROM), a random access memory(RAM), a magnetic storage medium device, a optical storage mediumdevice, a flash memory device, an electrical, optical or otherphysical/tangible (e.g., non-transitory) computer-readable storagemedium device, used to store one or more computer programs that controlthe operation of the portable device 100, and are executed by theprocessor 102. The sound playing device 106 may be any device suitablefor playing sound according to digital signals, such as, but not limitedto, a loudspeaker. The sound receiving device 108 may be any devicesuitable for receiving sound, such as, but not limited to, a microphone.

In one embodiment, the portable device 100 further comprises at leastone sensor (not shown in FIG. 1), comprising but not limited to a motionsensor, a light sensor, and a proximity sensor.

FIG. 2 illustrates a method for adjusting sound output for optimalreproduction, according to an embodiment. The method is applied in theportable device 100 and is executed by the processor 102 and stored inthe memory 104 to perform the following steps:

Step S202, the portable device 100 determines whether it is in a soundplaying state. If the portable device 100 determines that it is in thesound playing state, in order not to affect the user's listeningexperience (such as the output of sound are changed suddenly), theprocess ends and no sound playing adjustment is performed. Otherwise, ifthe portable device 100 determines that it is not in the sound playingstate, step S204 is executed.

Step S204, the portable device 100 controls the sound playing device 106to play detectable audio signals. In one embodiment, the detectableaudio signals are a plurality of repetitive waveforms with frequencychanges, comprising sawtooth, triangular, and sine waveforms. In oneembodiment, the detectable audio signals may be a plurality oftriangular waveforms that cannot be heard by human ears but isdetectable by the sound receiving device 108.

The sound frequency that humans can perceive has a certain range, andthe frequency range that most people can hear is between 20 Hz and 20KHz. However, the perception of human hearing for all frequencies is notlinear, but follows an equal loudness contour. For example, FIG. 3 showsequal loudness contours perceived by the human ear, where the Y axisrepresents the actual sound pressure level (SPL) in decibels (dB-SPL),and the X axis represents different frequencies in hertz (Hz). The unitof (also known as sound or volume) is the Phon. Zero phons representsthe quietest loudness that human ears can hear, which is also called theaudible threshold. Sounds below the audible threshold are inaudible tohuman ears. The various loudness contours shown in FIG. 3 show ameasurement at every 20 Phons as the arbitrary unit of measurement,showing the SPL required for sounds of different frequencies to causethe same loudness. Loudness is mainly determined by the SPL, increasingthe SPL increases the loudness. But the loudness of the sound alsodepends on the frequency and is not solely determined by the SPL. Asshown in FIG. 3, for a frequency of 20 Hz, an SPL of 70 decibels isrequired for the human ear to hear sound at this frequency, but for 3KHz, an SPL of −5 decibels is enough for the human ear to hear it.

In one embodiment, the equal loudness contours are stored in the memory104, the contours comprise a mapping relationship between loudnesslevel, frequency, and sound pressure levels. In order that thedetectable triangular audio signals are inaudible to a user of theportable device 100, the processor 102 may look up the equal loudnesscontours, and adjust the SPL of the detectable audio signals accordingto the equal loudness contours. The portable device 100 makes the soundpressure level lower than the audible threshold of the equal loudnesscontours, so that human ears are not able to hear the detectable audiosignals played out by the sound playing device 106. According to theauditory characteristics of the human ear, the frequency span resolutioncapability at the intermediate frequency or low frequency is greaterthan when it is at the high frequency. According to actual measurement,the resonance frequency of the space and surrounding objects where theportable device 100 is placed is below 10 KHz. To suit thecharacteristics of human hearing, the frequency bands from 20 Hz to 10KHz are divided into m frequency bands based on frequency logarithm, forexample, 13 frequency bands. The fundamental frequency of the detectableaudio signals is preset to increase gradually from 20 Hz to 770 Hz,divided into n frequency groups. For example, there are 16 frequencygroups, and the triangular waveform is composed of fundamental frequencysine waves to the 11th harmonic, so the detectable audio signals candetect the frequency domain characteristics of a reflected sound wave atthe highest 10 KHz. In one embodiment, the processor 102 can control thesound playing device 106 to sequentially play n frequency groups ofdetectable audio signals with different frequencies, from low frequencyto high frequency.

Step S206, the portable device 100 receives the reflected audio throughthe sound receiving device 108. Some of then frequency groups ofdetectable audio signals played in step S204 arrive directly at thesound receiving device 108 through air propagation, and the other partis formed by air propagation after being scattered by objects in theroom or other environment. After reflection of the waves, the other partof detectable audio signals arrive at the sound receiving device 108.The sound receiving device 108 receives and can superimpose audiosignals of the direct output and the reflected wave sounds, and thesound receiving device 108 then converts the received audio into the nfrequency groups of reflected audio waves.

Step S208, the portable device 100 obtains a list of weightings ofvolume of reference audio according to the preconfigured volume value.In one embodiment, before the portable device 100 is shipped from themanufacturer, the list of weightings is pre-stored corresponding todifferent volume values that can be set by a user through a userinterface of the portable device 100. In one embodiment, the portabledevice 100 may obtain reference audio corresponding to different volumevalues in a laboratory before shipping from the manufacturer. In oneembodiment, the reference audio is the audio received by the soundreceiving device 108 after the portable device 100 has played thedetectable audio in a free space. In one embodiment, the detectableaudio for a specific volume value comprise 16 frequency groups oftriangular sound waves from low frequency to high frequency. After thesound playing device 106 plays the detectable audio in the free space,the sound receiving device 108 receives the reference audio, which isthe detectable audio reflected and sent back. Taking the fundamentalfrequency amplitude of each frequency group of the reference audio as100%, the portable device 100 calculates 6 audio spectrum intensities ofthe reference audio for each frequency group and obtains a total of 16×6audio spectrum intensities which form a reference audio intensity matrixwith a dimension of 16×6. Then, the 16×6 detectable audio frequencymatrix (401 in FIG. 4) and the reference audio intensity matrix (402 inFIG. 4) are respectively converted into dimensions corresponding to mfrequency bands. In this embodiment, the 16×6 matrix is converted into amatrix with dimensions of 13×7, that is, m is set at 13, and theinsufficient or lacking matrix element part is filled with a specialvalue NaN (not a number) or a minimum value. The converted detectableaudio frequency matrix is 403 in FIG. 4, and the converted referenceaudio intensity matrix is 404 in FIG. 4. The detectable audio frequencymatrix after dimension conversion is scanned in rows and columns, andthe matrix elements are sorted in ascending powers according to theelement values, as 405 shows in FIG. 4. At the same time, the matrixelements in the reference audio intensity matrix are reordered, as 406shows in FIG. 4. The portable device 100 then calculates the square rootof each matrix element in each column and sums them, calculates a rootmean square for each sum to obtain 13 root mean square values, thesebeing used as the volume weighting in the list of weightings of volumeof the reference audio.

Step S210, the portable device 100 calculates and obtains a list ofweightings of volume of the reflected audio, and calculates firstadjustment coefficients of different frequency bands according to thelist of the reference audio and the list of the reflected audio in termsof weightings of volume.

In one embodiment, the method for calculating and obtaining the list ofweightings of volume of the reflected audio signals is the same as themethod for calculating and obtaining the list of weightings of volume ofthe reference audio. In this embodiment, taking the fundamentalfrequency amplitude of each frequency group of the reflected audio as100%, the portable device 100 can calculate 6 audio spectrum intensitiesof the reflected audio for each frequency group and obtain a total of16×6 audio spectrum intensities which form a reflected audio intensitymatrix with a dimension of 16×6. Then, the 16×6 detectable audiofrequency matrix and the reflected audio intensity matrix arerespectively converted into dimensions corresponding to m frequencybands. In this embodiment, the 16×6 matrix is converted into a matrixwith a dimension of 13×7, that is, m is set at 13, and the lackingmatrix element part is filled with a special value NaN or a minimumvalue. The detectable audio frequency matrix after dimension conversionis scanned in rows and columns, and the matrix elements are sorted inascending powers according to the element values. At the same time, thematrix elements in the reflected audio intensity matrix are alsoreordered according to their detectable audio frequencies. The squareroot of each matrix element in each column is found and summed, and aroot mean square for each sum is calculated, to obtain 13 root meansquare values which are used as the weightings in the list of weightingsof volume of the reflected audio.

In this embodiment, the method for calculating the first adjustmentcoefficients of the different frequency bands is that the ratio of eachelement in the list of weightings of volume of the reference audiosignals to each element in the list of weightings of volume of thereflected audio signals is calculated, and a total of 13 ratios therebyobtained. The 13 ratios are used as the first adjustment coefficientsfor 13 different frequency bands.

Step S212, the portable device 100 receives an audio file to be played,adjusts audio signals of the audio file according to the firstadjustment coefficients corresponding to the different frequency bands,and then outputs and plays the adjusted audio signals through the soundplaying device 106 as sound.

In this embodiment, the audio file is divided into a plurality of audioframes in units of 2048 samples, and the portable device 100 performsfast Fourier transform on each audio frame. Such transform converts theaudio signals from the original domain to the frequency domain,multiples the converted audio frame by the first adjustment coefficientof the corresponding frequency band, then performs an inverse Fouriertransform to convert back to the time domain. The adjusted audio file isfinally output through the sound playing device 106.

In this embodiment, the steps S202 to S210 obtain the frequency responsecharacteristics of the environment in which the portable device 100 isplaced. In another embodiment, in order to avoid excessive powerconsumption caused by frequent repetition of these steps, triggerconditions may be added to the process to reduce power consumption ofthe portable device 100. For example, the sensor data sent by the sensorof the portable device 100 can be used to determine whether the portabledevice 100 has been moved, whether the device 100 is moving orstationary, and, if now stationary, whether that state is maintained. Ifthe portable device 100 is entirely stationary during a predefinedperiod of time, it can be determined that the portable device 100 is ina static state. At this time, the portable device 100 can be triggeredto perform the steps S202 to S210 to obtain the frequency responsecharacteristic of the environment in which the portable device 100 isplaced. The predefined period of time may be set by factory default, forexample, the factory default value is one minute, or it may be set bythe user through the user interface. In another embodiment, the triggercondition may also be a specific condition set by the user through theuser interface.

In one embodiment, when the portable device 100 receives user command toincrease the volume of sound, the portable device 100 may, instead ofchanging the current volume setting, adjust the intensity values ofdifferent frequency bands instead to obtain the required sound levelwhile allowing a certain degree of distortion. The specific processsteps are shown in FIG. 5.

Step S502, the portable device 100 obtains matrix elements in thereflected audio intensity matrix that are greater than an average value.The method for obtaining the reflected audio intensity matrix is asdescribed in step S210. After calculating all the elements in thereflected audio intensity matrix to obtain the average value, all matrixelements greater than the average value are obtained.

Step S504, the portable device 100 normalizes the elements larger thanthe average value to obtain a new intensity matrix for reflected audio.That is to say, in the reflected audio intensity matrix, the intensityvalues of elements that are originally greater than the average valueare strengthened to form the new audio intensity matrix for reflectedsound.

Step S506, the portable device 100 obtains the list of weightings ofvolume of the corresponding reference audio according to the currentvolume setting.

Step S508, the portable device 100 calculates and obtains the list ofweightings of volume of the reflected audio and calculates and obtainssecond adjustment coefficients of different frequency bands according tothe lists of weightings of volume of the reference audio signals and ofthe reflected audio. The specific calculation method of the secondadjustment coefficient is the same as that in step S210.

Step S510, the portable device 100 adjusts audio signals of the audiofile to be played according to the second adjustment coefficients. Thespecific adjustment is the same as in step S212.

The method for adjusting sound playback and the portable device of thedisclosure detect the frequency response characteristics of theenvironment in which the portable device is placed before beingcommanded to playback sound. When there is an audio file needing to beplayed, the audio signals of each frequency band are fine-tuned toachieve an unchanging sound volume, which saves the power consumption ofthe portable device. When the user wants to increase the volume ofsound, the maximum volume can be achieved by adjusting the audio signalsaccording to the detected frequency response characteristics, albeit atthe cost of some distortion.

The embodiments shown and described above are only examples. Manydetails are often found in the art such as the other features of theportable device 100. Therefore, many such details are neither shown nordescribed. Even though numerous characteristics and advantages of thepresent technology have been set forth in the foregoing description,together with details of the structure and function of the presentdisclosure, the disclosure is illustrative only, and changes may be madein the detail, especially in matters of shape, size, and arrangement ofthe parts within the principles of the present disclosure, up to andincluding the full extent established by the broad general meaning ofthe terms used in the claims. It will therefore be appreciated that theembodiments described above may be modified within the scope of theclaims.

What is claimed is:
 1. A method for adjusting sound playback applied ina portable device, the method comprising: determining whether theportable device is in a sound playing state; playing detectable audiothrough a sound playing device of the portable device when it isdetermined that the portable device is not in a sound playing state;receiving reflected audio of the detectable audio through the soundreceiving device of the portable device; obtaining a list of weightingsof volume of reference audio according to a preconfigured volume value;calculating and obtaining a list of weightings of the reflected audio,and calculating first adjustment coefficients of different frequencybands according to the list of weightings of volume of the referenceaudio and the list of weightings of volume of the reflected audio;receiving an audio file to be played; adjusting audio signals of theaudio file according to the first adjustment coefficients; and playingthe audio file after adjustment through the sound playing device.
 2. Themethod of claim 1, wherein the detectable audio comprise n groups oftriangular waveforms, and fundamental frequencies of each group of thetriangular waveforms is preset to increase gradually from 20 Hz to 770Hz.
 3. The method of claim 2, wherein the method further comprises:adjusting a sound pressure level of each of the triangular waveformsaccording to audible thresholds in contours of equal loudness.
 4. Themethod of claim 2, wherein the method further comprises: calculating aaudio intensity matrix of the reflected audio according to amplitudes ofthe fundamental frequencies of the detectable audio; and calculating thelist of weightings of volume of the reflected audio according to theaudio intensity matrix and the detectable audio.
 5. A portable devicefor adjusting sound playback, the portable device comprising: a soundplaying device; a sound receiving device; a processor; and a memory forstoring at least one computer program, wherein the at least one computerprogram comprises instructions which are executed by the processor, andperforms a method comprising: determining whether the portable device isin a sound playing state; playing detectable audio through the soundplaying device when it is determined that the portable device is not ina sound playing state; receiving reflected audio of the detectable audiothrough the sound receiving device; obtaining a list of weightings ofvolume of reference audio according to a preconfigured volume value;calculating and obtaining a list of weightings of volume of thereflected audio, and calculating first adjustment coefficients ofdifferent frequency bands according to the list of weightings of volumeof the reference audio and the list of weightings of volume of thereflected audio; receiving an audio file to be played; adjusting playingaudio signals of the audio file according to the first adjustmentcoefficients; and playing the audio file through the sound playingdevice after adjustment.
 6. The portable device of claim 5, wherein thedetectable audio comprises n groups of triangular waveforms, andfundamental frequencies of each group of the triangular waveforms ispreset to increase gradually from 20 Hz to 770 Hz.
 7. The portabledevice of claim 6, wherein the processor is further instructed to:adjusting a sound pressure level of each of the triangular waveformsaccording to audible thresholds of contours of equal loudness.
 8. Theportable device of claim 6, wherein the processor is further instructedto: calculating an audio intensity matrix of the reflected audioaccording to amplitudes of the fundamental frequencies of the detectableaudio; calculating the list of weightings of volume of the reflectedaudio according to the audio intensity matrix and the detectable audio.